package com.woniuxy.kaer.system.mapper;

import com.woniuxy.kaer.system.model.Resources;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author sun
 * @since 2025年02月17日
 */
@Mapper
public interface ResourceMapper extends BaseMapper<Resources> {
    @Select("SELECT p.resource_name " +
            "FROM role r " +
            "JOIN role_resource rp ON r.role_id = rp.role_id " +
            "JOIN resource p ON rp.resource_id = p.resource_id " +
            "WHERE r.role_id = #{roleId};")
    List<String> selectResourceByRoleId(Integer roleId);
}
